/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80029
 Source Host           : localhost:3306
 Source Schema         : DB_Parking

 Target Server Type    : MySQL
 Target Server Version : 80029
 File Encoding         : 65001

 Date: 09/12/2024 10:00:02
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for car
-- ----------------------------
DROP TABLE IF EXISTS `car`;
CREATE TABLE `car` (
  `tid` int NOT NULL AUTO_INCREMENT COMMENT '车辆编号',
  `card` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车牌号',
  `car_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车类别',
  `person` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户',
  `xtime` datetime DEFAULT NULL COMMENT '录入时间',
  PRIMARY KEY (`tid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of car
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fee
-- ----------------------------
DROP TABLE IF EXISTS `fee`;
CREATE TABLE `fee` (
  `fid` int NOT NULL AUTO_INCREMENT COMMENT '收费标准ID',
  `car_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位类型',
  `money` double(255,2) DEFAULT NULL COMMENT '价格',
  `money_desc` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '价格描述',
  `fee_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`fid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of fee
-- ----------------------------
BEGIN;
INSERT INTO `fee` VALUES (11, '临时车位', 12.00, '临时车位价格', '2022-04-09 08:50:53');
INSERT INTO `fee` VALUES (13, '固定车位', 33.00, '固定车位价格', '2022-04-09 08:51:23');
COMMIT;

-- ----------------------------
-- Table structure for login_info
-- ----------------------------
DROP TABLE IF EXISTS `login_info`;
CREATE TABLE `login_info` (
  `yid` int NOT NULL AUTO_INCREMENT COMMENT '登录日志编号                                                                                      ',
  `person` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户',
  `ip` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'IP地址',
  `browser` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '浏览器',
  `os` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '操作系统',
  `login_time` datetime DEFAULT NULL COMMENT '登录时间',
  PRIMARY KEY (`yid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of login_info
-- ----------------------------
BEGIN;
INSERT INTO `login_info` VALUES (134, 'test', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 18:56:48');
INSERT INTO `login_info` VALUES (135, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 18:56:57');
INSERT INTO `login_info` VALUES (136, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 18:58:21');
INSERT INTO `login_info` VALUES (137, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 19:00:35');
INSERT INTO `login_info` VALUES (138, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 19:01:22');
INSERT INTO `login_info` VALUES (139, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 19:01:51');
INSERT INTO `login_info` VALUES (140, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 19:22:33');
INSERT INTO `login_info` VALUES (141, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 20:23:37');
INSERT INTO `login_info` VALUES (142, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 21:14:52');
INSERT INTO `login_info` VALUES (143, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 21:15:57');
INSERT INTO `login_info` VALUES (144, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-08 21:16:49');
INSERT INTO `login_info` VALUES (145, 'admin', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-09 09:49:39');
INSERT INTO `login_info` VALUES (146, 'user', '127.0.0.1', 'Chrome 12', 'Mac OS X', '2024-12-09 09:50:39');
COMMIT;

-- ----------------------------
-- Table structure for recharge
-- ----------------------------
DROP TABLE IF EXISTS `recharge`;
CREATE TABLE `recharge` (
  `cid` int NOT NULL AUTO_INCREMENT COMMENT '充值编号',
  `person` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户',
  `money` double(255,2) DEFAULT NULL COMMENT '充值金额',
  `ctime` datetime DEFAULT NULL COMMENT '充值时间',
  PRIMARY KEY (`cid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of recharge
-- ----------------------------
BEGIN;
INSERT INTO `recharge` VALUES (17, 'user', 20.00, '2024-07-17 23:22:01');
INSERT INTO `recharge` VALUES (18, 'user', 0.00, '2024-07-17 23:23:04');
INSERT INTO `recharge` VALUES (19, 'user', 130.00, '2024-07-17 23:23:06');
INSERT INTO `recharge` VALUES (20, 'user', 240.00, '2024-07-17 23:23:08');
INSERT INTO `recharge` VALUES (21, 'user', 480.00, '2024-07-17 23:23:10');
INSERT INTO `recharge` VALUES (22, 'user', 0.00, '2024-07-17 23:30:09');
INSERT INTO `recharge` VALUES (23, 'user', 31.00, '2024-07-18 22:32:51');
INSERT INTO `recharge` VALUES (24, 'user', 0.00, '2024-07-18 22:34:24');
INSERT INTO `recharge` VALUES (25, 'user', 1165.00, '2024-12-03 08:45:46');
INSERT INTO `recharge` VALUES (26, 'user', 15.00, '2024-12-03 10:24:52');
INSERT INTO `recharge` VALUES (27, 'user', 16.00, '2024-12-03 10:31:29');
INSERT INTO `recharge` VALUES (28, 'user', 0.00, '2024-12-03 10:31:48');
INSERT INTO `recharge` VALUES (29, 'user', 100.00, '2024-12-03 11:10:01');
INSERT INTO `recharge` VALUES (30, 'user', 116.40, '2024-12-03 18:35:41');
INSERT INTO `recharge` VALUES (31, 'user', 6.00, '2024-12-03 22:09:59');
INSERT INTO `recharge` VALUES (32, 'user', 6.00, '2024-12-03 22:10:02');
INSERT INTO `recharge` VALUES (33, 'user', 0.00, '2024-12-08 19:00:51');
COMMIT;

-- ----------------------------
-- Table structure for stall
-- ----------------------------
DROP TABLE IF EXISTS `stall`;
CREATE TABLE `stall` (
  `sid` int NOT NULL AUTO_INCREMENT COMMENT '车位编号',
  `stall_num` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位号',
  `stall_area` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位区域',
  `stall_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位类型',
  `stall_state` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位状态',
  `stall_money` double(255,0) DEFAULT NULL COMMENT '车位收费',
  `stall_live` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '逻辑删除标志，1为可见，0为不可见',
  `user_id` int DEFAULT NULL COMMENT '用户编号',
  PRIMARY KEY (`sid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of stall
-- ----------------------------
BEGIN;
INSERT INTO `stall` VALUES (9, 'A01', '兔子小区', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (10, 'A02', '兔子小区', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (11, 'A03', '兔子小区', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (12, 'B01', '兔子小区', '固定车位', '空闲中', 33, '0', NULL);
INSERT INTO `stall` VALUES (13, 'B02', '兔子小区', '固定车位', '空闲中', 33, '0', NULL);
INSERT INTO `stall` VALUES (14, 'A04', '兔子小区', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (15, 'C22', '测试小区', '固定车位', '空闲中', 33, '0', NULL);
INSERT INTO `stall` VALUES (16, '123', '123', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (17, '001', '幸福家园小区', '临时车位', '空闲中', 12, '0', NULL);
INSERT INTO `stall` VALUES (18, '001', '幸福家园小区01', '临时车位', '空闲中', 12, '1', NULL);
INSERT INTO `stall` VALUES (19, '002', '幸福家园小区02', '临时车位', '已停车', 12, '1', 2);
INSERT INTO `stall` VALUES (20, '003', '幸福家园小区03', '固定车位', '已停车', 33, '1', 2);
INSERT INTO `stall` VALUES (21, '004', '幸福家园小区04', '固定车位', '空闲中', 33, '1', NULL);
COMMIT;

-- ----------------------------
-- Table structure for stall_res
-- ----------------------------
DROP TABLE IF EXISTS `stall_res`;
CREATE TABLE `stall_res` (
  `pid` int NOT NULL AUTO_INCREMENT COMMENT '停车记录ID',
  `person` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '停车用户',
  `stall_id` int DEFAULT NULL COMMENT '车位编码',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `over_time` datetime DEFAULT NULL COMMENT '结束时间',
  `pay_money` double(255,2) DEFAULT NULL COMMENT '缴费金额',
  PRIMARY KEY (`pid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of stall_res
-- ----------------------------
BEGIN;
INSERT INTO `stall_res` VALUES (30, 'user', 18, '2024-12-08 19:00:41', '2024-12-08 19:00:51', 0.00);
INSERT INTO `stall_res` VALUES (31, 'user', 19, '2024-12-08 19:00:42', NULL, NULL);
INSERT INTO `stall_res` VALUES (32, 'user', 20, '2024-12-08 19:01:55', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for stall_type
-- ----------------------------
DROP TABLE IF EXISTS `stall_type`;
CREATE TABLE `stall_type` (
  `oid` int NOT NULL COMMENT '车位类型编号',
  `otype` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车位类型',
  `omoney` double(255,0) DEFAULT NULL COMMENT '车位价格',
  PRIMARY KEY (`oid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of stall_type
-- ----------------------------
BEGIN;
INSERT INTO `stall_type` VALUES (1, '临时车位', 12);
INSERT INTO `stall_type` VALUES (2, '固定车位', 33);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `uid` int NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(150) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码',
  `nike` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '昵称',
  `age` int DEFAULT NULL COMMENT '年龄',
  `sex` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别',
  `phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系方式',
  `card` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车牌号',
  `money` double(255,2) DEFAULT NULL COMMENT '余额',
  `role` int NOT NULL DEFAULT '1' COMMENT '角色。0系统管理员，1车主',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`uid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'admin', '123456', '系统管理员', 18, '男', '13574659211', NULL, NULL, 0, '2024-03-21 11:52:24');
INSERT INTO `user` VALUES (2, 'user', '123456', '幸福家园科技', 29, '男', '18679122222', '浙江K12333', 10500.00, 1, '2024-07-15 23:48:56');
INSERT INTO `user` VALUES (3, 'test', '123456', '陈先生', 30, '男', '18677772222', '浙A38292', NULL, 1, '2024-12-08 18:56:24');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
